# Contributor: Carlo Landmeter <clandmeter@alpinelinux.org>
# Maintainer: Michael Mason <ms13sp@gmail.com>
pkgname=mailx
pkgver=8.1.1
pkgrel=2
pkgdesc="commandline utility for sending email"
options="suid !check" # No testsuite
url="http://www.opengroup.org/onlinepubs/007908799/xcu/mailx.html"
arch="all"
license="BSD-4-Clause-UC"
makedepends="bsd-compat-headers"
subpackages="$pkgname-doc"
source="https://sources.archlinux.org/other/mailx/mailx-$pkgver-fixed.tar.gz
	mailx-8.1.1.patch
	musl-fix.patch
	mailx-gcc4.patch
	respect-flags.patch
	"

builddir="$srcdir/$pkgname-$pkgver-fixed"

prepare() {
	default_prepare
	sed -i 's#/man/#/share/man/#' Makefile
}

build() {
	CFLAGS="$CFLAGS -fcommon" make
}

package() {
	make DESTDIR="$pkgdir" install
}

sha512sums="adfb1ae796505f2706d03e34ae9b89f45dd878d55014ae8fab91fbf4b53f1bd97e0ac78ce1af5999adf62e99230f91d9539605ae388cf6c16e8334c14c0cce10  mailx-8.1.1-fixed.tar.gz
05c4185ef54601c9bae6b6505201a9b357f69d9d22c4b992a9ba52f4022b8dec2d0e5b97654fff7c9f303bdcc87ab8bb279a7293fdd538d4291dcd99f6eae1d4  mailx-8.1.1.patch
de633d557552c38e221cd48c0cf6cefe108f22332eab5e155183463b0209a08b1ae6754508a12bf9f261a345b2feb1a4e607167d51b7a16e60d47c3c02d0218f  musl-fix.patch
e3fa1016da2cd1583e1ba2f6cd05566385607e144da2766101e4bf8c8dc089c4b956d1d90ccc040e5faf31c98d0855a0bc909bf0d6538df34925e798bba1a074  mailx-gcc4.patch
ec9a85c53c6e979947a5589b8bddcf81ac6d46f696ec21e65e6a50d316f1f27644f460ce6093d1840aaae035de9dd8361e6104cdd1e8ba50744356377a016b1d  respect-flags.patch"
